<template>
	<page-body>
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center feedba_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub feedba_fd0_0'>
					<view class='flex flex-wrap align-center feedba_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
						:data-url="1">
						<text class='fu-iconfont2  feedba_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='feedba_fd0_0_c1_c0'>我要反馈</text>
					</view>
					<view class='flex flex-wrap align-center justify-end feedba_fd0_0_c0'>
						<text class='feedba_fd0_0_c2_c0'  @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/My/feelist/feelist`">反馈记录</text>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout feedba_flex_1">
				<view class='flex flex-direction flex-wrap align-stretch feedba_fd1_0'>
					<text class='feedba_fd1_0_c0'>反馈类型</text>
					<view class='flex flex-wrap align-center justify-between'>
						<benben-select-diy ref="showSelectPopup1724831885586"
							class-name='flex flex-wrap flex feedba_fd1_0_c1_c0' :items.sync="typeList"
							v-model="ruoidsVal" :label.sync="rouidsLable" default-type="value" default-label="name"
							:allow-cancel='false' type="radio" :disabled='false'>
							<template v-for='(item,key0) in typeList'>
								<view v-if="item.style" class='flex justify-center flex feedba_fd1_0_c1_c0_c0'
									:key="key0" @tap="$refs.showSelectPopup1724831885586.tapHandle(key0)">
									<text @tap.stop="dafFunc(item.title,item.aid)">{{item.title}}</text>
								</view>
								<view v-else class='flex justify-center flex feedba_fd1_0_c1_c0_c1' :key="key0"
									@tap="$refs.showSelectPopup1724831885586.tapHandle(key0)">
									<text @tap.stop="dafFunc(item.title,item.aid)">{{item.title}}</text>
								</view>
							</template></benben-select-diy>
					</view>
				</view>
				<view class='flex flex-direction flex-wrap align-stretch feedba_fd1_0'>
					<text class='feedba_fd1_0_c0'>反馈内容</text>
					<view class='flex flex-wrap align-center justify-between feedba_fd1_1_c1'>
						<view class='flex flex-wrap feedba_fd1_1_c1_c0'>
							<benben-textarea class='flex feedba_input_fd1_1_c1_c0'
								:placeholder="'问题描述的越详细，有助于我们更快的解决问题'" :adjust-position='true' :maxlength="240"
								:show-num='true' placeholder-style="color:#999;font-size:28rpx" v-model="body" />
							<template>
								<view class='flex flex justify-end feedba_numberfd1_1_c1_c0_c0'>
									<text>{{body.length}}</text>
									<text>/</text>
									<text>240</text>
								</view>
							</template>
						</view>
					</view>
					<benben-images-upload ref="benbenImagesUploadfd1_1_c2" :img-list.sync="thumb" :is-show-tips='true'
						:maxlength="6">
						<template #content="{ num, maxlength, isShow}"> 
							<view class="flex flex-wrap align-start flex feedba_fd1_1_c2">
								<view v-for="(image, index) in thumb" :key="index"
									class='flex position-relative feedba_fd1_1_c20'>
									<text class='fu-iconfont2 position-absolute feedba_fd1_1_c200'
										@tap.stop="$refs.benbenImagesUploadfd1_1_c2.delImage(index)">&#xE8E7;</text>
									<image class='feedba_fd1_1_c201'
										@tap.stop="$refs.benbenImagesUploadfd1_1_c2.previewImage(index)"
										mode="aspectFit" :src='image'></image>
								</view>


								<image class='feedba_fd1_1_c21'
									@tap.stop="$refs.benbenImagesUploadfd1_1_c2.manyChooseImage()" v-if="isShow"
									mode="aspectFit" src='/static/images/76.png'></image>
								<text
									class='image_upload_tips feedba_fd1_1_c22'>请上传应用截图，最多上传{{num}}/{{maxlength}}张图片</text>
							</view>
						</template>
					</benben-images-upload>
				</view>
			<!-- 	<view class='flex flex-direction flex-wrap align-stretch feedba_fd1_0'>
					<text class='feedba_fd1_0_c0'>请留下您的联系方式</text>
					<benben-input class='feedba_fd1_2_c1' type="text" :placeholder="`手机号/邮箱/QQ号`" confirm-type="done"
						:maxlength="-1" :adjust-position='true' placeholder-style="color:#999;font-size:28rpx"
						v-model="contact" />
				</view> -->
			</view>

			<!---flex布局flex布局结束-->
			<view class="flex flex-direction flex-wrap align-center benben-position-layout flex feedba_flex_2"
				:style="{height:(150+bottomSafeAreaRpx)+'rpx',paddingBottom:bottomSafeAreaRpx+'rpx', }">
				<button class='feedba_fd2_0' @tap.stop="getgq36dc0bcb5991Func()">提交反馈</button>

			</view>
			<view :style="{height: (150+bottomSafeAreaRpx)+'rpx'}"></view>


		</view>
	</page-body>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"typeList": [],
				"ruoidsVal": "",
				"rouidsLable": "",
				"body": "",
				"thumb": [],
				"contact": ""
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {
			this.getgs36dbfbfd7b81Func()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//意见反馈-反馈类型
			async getgs36dbfbfd7b81Func() {
				//请求方法
				//数据验证

				let datatypeList = await this.$api.get(global.apiUrls.post6414719bdc956, {

				});

				if (datatypeList.data.code != 1) {
					this.$message.info(datatypeList.data.msg);
					return
				}
				let infotypeList = datatypeList.data;
				this.typeList = infotypeList.data

			},
			//111
			dafFunc(val, id) {
				this.ruoidsVal = id;
				this.rouidsLable = val;
				console.log("选择了=>", this.ruoidsVal)
				this.typeList.forEach(item => {
					item.style = false
					if (item.aid == this.ruoidsVal) {
						item.style = true
					}
				})
				console.log("选择了=>", this.rouidsLable)
			},
			//意见反馈-提交反馈信息
			async getgq36dc0bcb5991Func() {
				let thumbs = this.thumb.join(',')
				//请求方法
				//数据验证

				let data636dc0bcb5991 = await this.$api.post(global.apiUrls.post6414724b96f3f, {
					operationsuggestionstype_id: this.ruoidsVal,
					body: this.body,
					thumb: thumbs,
					// contact: this.contact
				});

				console.log(';;;;;;;;;;;;;;;;;;;;', data636dc0bcb5991);

				if (data636dc0bcb5991.data.code != 1) {
					this.$message.info(data636dc0bcb5991.data.msg);
					return
				}
				let info636dc0bcb5991 = data636dc0bcb5991.data;


				uni.showToast({
					title: '提交成功',
					mask: true,
					icon: 'none',
					duration: 1000
				});

				setTimeout(() => {
					uni.navigateBack({
						delta: 1 // 返回层数，1 表示返回上一层（默认）
					})
				}, 1500)


			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F6f6f6;
		background-size: 100% auto;
	}

	.feedba_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.feedba_fd0_0_c2_c0 {
		color: rgba(51, 51, 51, 1);
	}

	.feedba_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 700;
		color: #333333;
		line-height: 50rpx;
	}

	.feedba_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.feedba_fd0_0_c0 {
		width: 120rpx;
	}

	.feedba_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.feedba_flex_1 {
		margin: 24rpx 0rpx 0rpx 0rpx;
	}

	.feedba_fd1_2_c1 {
		border-bottom: 1px solid #eee;
	}

	.feedba_fd1_1_c22 {
		font-size: 32rpx;
		color: #d5d5d5;
	}

	.feedba_fd1_1_c21 {
		width: 160rpx;
		height: 160rpx;
		margin: 0rpx 24rpx 24rpx 0rpx;
	}

	.feedba_fd1_1_c201 {
		width: 160rpx;
		height: 160rpx;
	}

	.feedba_fd1_1_c200 {
		top: 0rpx;
		right: 0rpx;
		z-index: 10;
		color: #ff5536;
	}

	.feedba_fd1_1_c20 {
		margin: 0rpx 24rpx 24rpx 0rpx;
	}

	.feedba_fd1_1_c2 {
		width: 100%;
		padding: 24rpx 0rpx 0rpx 24rpx;
	}

	.feedba_numberfd1_1_c1_c0_c0 {
		width: 100%;
		font-size: 24rpx;
		color: #FFFFFF;
		line-height: 46rpx;
		font-weight: 400;
	}

	.feedba_input_fd1_1_c1_c0 {
		width: 682rpx;
		height: 140rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
	}

	.feedba_fd1_1_c1_c0 {
		width: 682rpx;
		border-radius: 10rpx 10rpx 10rpx 10rpx;
		padding: 10rpx 10rpx 0rpx 16rpx;
	}

	.feedba_fd1_1_c1 {
		width: 682rpx;
	}

	.feedba_fd1_0_c1_c0_c1 {
		border: 1px solid #eee;
		width: 206rpx;
		height: 64rpx;
		line-height: 64rpx;
		border-radius: 8rpx;
		margin: 0rpx 20rpx 34rpx 0rpx;
		color: rgba(153, 153, 153, 1);
	}

	.feedba_fd1_0_c1_c0_c0 {
		background: #145efd;
		width: 206rpx;
		height: 64rpx;
		line-height: 64rpx;
		border-radius: 8rpx;
		color: rgba(255, 255, 255, 1);
		background-size: 100% auto;
		margin: 0rpx 20rpx 34rpx 0rpx;
	}

	::v-deep .feedba_fd1_0_c1_c0 {
		width: 100%;
	}

	.feedba_fd1_0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		line-height: 45rpx;
		margin: 0rpx 0rpx 32rpx 0rpx;
	}

	.feedba_fd1_0 {
		background: rgba(255, 255, 255, 1);
		padding: 32rpx;
		background-size: 100% auto;
		margin: 0rpx 0rpx 20rpx 0rpx;
	}

	.feedba_flex_2 {
		width: 750rpx;
		height: 150rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
	}

	.feedba_fd2_0 {
		background: #145efd;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #fff;
		height: 88rpx;
		line-height: 88rpx;
		width: 638rpx;
	}
</style>